#ifndef MAINWIDGET_H
#define MAINWIDGET_H

#include <QWidget>
#include<buyer.h>
#include<station.h>
#include<tcpserve.h>
#include<tcpsocket.h>
namespace Ui {
class mainWidget;
}

class mainWidget : public QWidget
{
    Q_OBJECT

public:
    explicit mainWidget(QWidget *parent = 0);
    ~mainWidget();
    void searching();    //查询余票
    void buying();         // 购票
    void cancell(QString nameoriden);        //退票
     void seek_information(QString nameoriden);  // 查询车票信息
     double get_sum_prise(QString station1,QString station2);   //获取票价
     void settickets(QString station1,QString station2);  //买票时票数-1
     void addtickets(QString station1,QString station2);  //退票后票数+1


private slots:
     void on_pushButton_2_clicked();

     void on_book_clicked();

     void on_pushButton_3_clicked();

     void on_pushButton_4_clicked();

private:
    Ui::mainWidget *ui;
    buyer buyerinf[100];   //存放buyer的信息
    station Station[10];     //存放车站信息
    QTcpServer *serve;    //监听套接字
    QTcpSocket *mysocket; // 通信套接字


};

#endif // MAINWIDGET_H
